cmake_minimum_required(VERSION 3.0)

project(hls)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

INCLUDE_DIRECTORIES(./)
INCLUDE_DIRECTORIES(./../)
INCLUDE_DIRECTORIES(./../../)

set(main_hls_src_list ./main.cpp
  ./http_hls_connection.cpp
  ./hls_client.cpp
  ./../../public_module/hls_protocol/hls_m3u8_message.cpp
  ./../../public_module/hls_protocol/hls_m3u8_parser.cpp
  ./../../public_module/loop_module/loop.cpp
  ./../../public_module/description_module/description_util.cpp
  ./../../public_module/io_reuse_module/io_epoll.cpp
  ./../../public_module/io_reuse_module/io_poll.cpp
  ./../../public_module/io_reuse_module/io_reuse_module.cpp
  ./../../public_module/socket_module/socket_address.cpp
  ./../../public_module/socket_module/socket_channel.cpp
  ./../../public_module/socket_module/socket_description.cpp
  ./../../public_module/socket_module/tcp_socket_connection.cpp
  ./../../public_module/socket_module/tls_socket_connection.cpp
  ./../../public_module/socket_module/tls_socket_operate.cpp
  ./../../public_module/write_read_module/buffer.cpp
  ./../../public_module/file_module/file_description.cpp
  ./../../public_module/file_module/file_operate.cpp
  ./../../public_module/file_module/file_handle.cpp
  ./../../public_module/protocol_center/protocol.center.cpp
  ./../../public_module/protocol_center/protocol_parser.cpp
  ./../../public_module/http_connection/http_connection.cpp
  ./../../public_module/http_protocol/http_protocol_msg.cpp
  ./../../public_module/http_protocol/http_protocol_parser.cpp)

add_executable(MAIN_HLS_SRC_LIST ${main_hls_src_list})

set(main_file_parser_hls_m3u8_src_list ./file_main.cpp
  ./../../public_module/hls_protocol/hls_m3u8_parser.cpp
  ./../../public_module/hls_protocol/hls_m3u8_message.cpp
  ./../../public_module/file_module/file_handle.cpp
  ./../../public_module/file_module/file_operate.cpp
  ./../../public_module/file_module/file_description.cpp
  ./../../public_module/write_read_module/buffer.cpp)

add_executable(MAIN_FILE_PARSER_HLS_M3U8 ${main_file_parser_hls_m3u8_src_list})

set(main_hls_client_src_list ./hls_client_main.cpp
        ./http_hls_connection.cpp
        ./hls_client.cpp
		./hls_protocol_client.cpp
		./../../public_module/hls_protocol/hls_m3u8_message.cpp
		./../../public_module/hls_protocol/hls_m3u8_parser.cpp
        ./../../public_module/loop_module/loop.cpp
        ./../../public_module/description_module/description_util.cpp
        ./../../public_module/io_reuse_module/io_epoll.cpp
        ./../../public_module/io_reuse_module/io_poll.cpp
        ./../../public_module/io_reuse_module/io_reuse_module.cpp
        ./../../public_module/socket_module/socket_address.cpp
        ./../../public_module/socket_module/socket_channel.cpp
        ./../../public_module/socket_module/socket_description.cpp
        ./../../public_module/socket_module/tcp_socket_connection.cpp
        ./../../public_module/socket_module/tls_socket_connection.cpp
        ./../../public_module/socket_module/tls_socket_operate.cpp
		./../../public_module/socket_module/udp_socket_connection.cpp
		./../../public_module/socket_module/socket_connection_util.cpp
        ./../../public_module/file_module/file_description.cpp
        ./../../public_module/file_module/file_operate.cpp
        ./../../public_module/file_module/file_handle.cpp
		./../../public_module/protocol_connection/hls_protocol_operation.cpp
		./../../public_module/protocol_connection/http_protocol_operation.cpp
		./../../public_module/protocol_connection/protocol_connection.cpp
        ./../../public_module/write_read_module/buffer.cpp
        ./../../public_module/protocol_center/protocol.center.cpp
        ./../../public_module/protocol_center/protocol_parser.cpp
        ./../../public_module/http_connection/http_connection.cpp
        ./../../public_module/http_protocol/http_protocol_msg.cpp
		./../../public_module/openssl_util/openssl_util.cpp
		./../../public_module/http_protocol/http_protocol_parser.cpp)

add_executable(MAIN_HLS_CLIENT ${main_hls_client_src_list})

set(libs ssl crypto pthread)

target_link_libraries(MAIN_HLS_SRC_LIST ${libs})
target_link_libraries(MAIN_HLS_CLIENT ${libs})


